Repository navigation
fix: an XSS in descriptions and two frontend bugs found by the coverage tests - #687
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bugs that writing the coverage tests in #688 turned up, one commit each. Each has a regression test that fails without its fix.
<img onerror>or<script>in a description ran for anyone who opened the file, and a link could close its ownhrefand add attributes such asonmouseover. Descriptions are written by whoever uploaded the file upstream, and the session token is inlocalStorage. Every part of a description is now escaped, only a wholehttporhttpsaddress becomes a link (withrel="noopener noreferrer"), and the result goes through Angular's sanitizer instead of around it. The unusedparseText(), which built the same unescaped HTML, is gone.loadConfig()passed it tosetTheme(), which refused it, so no theme was applied and the theme toggle in the account menu threw on the theme that was never set, both in its template and when clicked. Clearing site data was the only way out. A stored theme that does not exist now counts as none, so the default applies, and a configured default that does not exist falls back to the light theme. Theme names are checked against the config's own keys, soconstructoris not one.Validation on Node 26.13.0: 1,431 frontend tests passed; lint and the app type check passed. No backend changes.